﻿@{
    Layout = "~/Views/Shared/_ModalForm.cshtml";
    string url = ViewBag.Url;
    string updateDataUrl = ViewBag.UpdateDataUrl;
}


<div class="wrapper">
<div id="relatedIds" col="RelatedIds"></div>
</div>

<script type="text/javascript">
    var url = '@Html.Raw(url)';
    var updateDataUrl = '@Html.Raw(updateDataUrl)';

    $(function () {

        ys.ajax({
            url: url,
            type: "get",
            success: function (rst) {
                if (rst.Flag == 1) {
                    $("#relatedIds").ysComboBox({
                        data: rst.Data ,
                        class: "form-control",
                        multiple: true
                    });
                }
                else ys.msgError(rst.Message);
            }
        });

    });


    function getSelectedIds() {
        var ids = $('#relatedIds').ysComboBox("getValue");
        return ids;
    }

</script>
